import { NgModule } from '@angular/core';
import { SharedModule } from 'src/app/shared/shared.module';

import { Routes, RouterModule } from '@angular/router';

// 导入 ngx-echarts
import { NgxEchartsModule } from 'ngx-echarts';

import { ApplicationComponent } from './pages/application.component';
import { AppListComponent } from './pages/app-list/app-list.component';
import { AppDetailComponent } from './pages/app-detail/app-detail.component';
import { CreateApplicationComponent } from './pages/app-list/create-application/create-application.component';
import { UploadWarComponent } from './pages/app-list/upload-war/upload-war.component';
import { UploadDependCheckComponent } from './pages/app-list/upload-depend-check/upload-depend-check.component';

// 路由配置
const routes: Routes = [
  {
    // 一级路由
    path: '', component: ApplicationComponent,
    // 二级路由
    children: [
      {
        path: '', component: AppListComponent,
        data: { breadcrumb: '应用列表' }
      },
      {
        path: 'app-list', component: AppListComponent,
        data: { breadcrumb: '应用列表' }
      },
      {
        path: 'app-detail', component: AppDetailComponent,
        data: { breadcrumb: '应用详情' }
      }
    ]
  },
];

@NgModule({
  imports: [
    SharedModule,
    NgxEchartsModule,
    RouterModule.forChild(routes)
  ],
  declarations: [
    AppListComponent,
    ApplicationComponent,
    AppDetailComponent,
    CreateApplicationComponent,
    UploadWarComponent,
    UploadDependCheckComponent
  ],
  entryComponents: [
    CreateApplicationComponent,
    UploadWarComponent,
    UploadDependCheckComponent
  ]
})
export class ApplicationModule { }
